<?php

App::uses('AppController', 'Controller');

class PagesController extends AppController
{
    public $name = 'Pages';
    public $uses = array('User', 'Scrap');
    
    public function beforeFilter()
    {
        //die(debug(Configure::read('resultPage')));
        parent::beforeFilter();
    }
    

    function index()
    {
        $scraps = $this->Scrap->find('all', array('order'=>'created DESC'));
        $this->set('scraps',$scraps);
        
        $last_scrap = $this->Scrap->find('first', array('order'=>'created DESC'));
        $this->set('last_scrap',$last_scrap);
    }
    
    function telao()
    {
        $this->layout="telao";
        $scraps = $this->Scrap->find('all', array('order'=>'created DESC'));
        $this->set('scraps',$scraps);
        
        $last_scrap = $this->Scrap->find('first', array('order'=>'created DESC'));
        $this->set('last_scrap',$last_scrap);
    }
    function facebook()
    {
        $this->layout = 'face';
    }
}
